﻿namespace JanusTestProject
{
    using JanusLibAing;
    using Microsoft.VisualStudio.TestTools.UnitTesting;


    /// <summary>
    /// This is a test class for EncryptorXteaTest and is intended
    /// to contain all EncryptorXteaTest Unit Tests
    /// </summary>
    [TestClass()]
    public class EncryptorXteaTest
    {
        private TestContext testContextInstance;

        // key must be 16 bytes
        uint[] key = new uint[]
                             {
                                 0x7856, 0x3412, 0xf0cd, 0xcb9a,
                                 0x4837, 0x2615, 0xc0bf, 0xae9d
                             };

        /// <summary>
        /// Gets or sets the test context which provides
        /// information about and functionality for the current test run.
        /// </summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }

            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        /// A test for Xtea1Decipher
        /// </summary>
        [TestMethod()]
        public void Xtea1DecipherTest()
        {
            // value must be 8 bytes
            uint[] value = new uint[]
                             {
                                 0x12345678, 0x87654321
                             };

            EncryptorXtea target = new EncryptorXtea(); 
            int num_rounds = 24;
            target.Xtea1Decipher(num_rounds, value, key);
        }

        /// <summary>
        /// A test for Xtea1Encipher
        /// </summary>
        [TestMethod()]
        public void Xtea1EncipherTest()
        {
            EncryptorXtea target = new EncryptorXtea(); // TODO: Initialize to an appropriate value
            int num_rounds = 0; // TODO: Initialize to an appropriate value
            uint[] v = null; // TODO: Initialize to an appropriate value
            uint[] key = null; // TODO: Initialize to an appropriate value
            target.Xtea1Encipher(num_rounds, v, key);
        }
    }
}
